self.addEventListener('message', function(e) {
    theUrl = "http://api.openweathermap.org/data/2.5/weather?q=" + e.data + ",at";
    var xmlHttp = null;

    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    xmlHttp.send( null );
    self.postMessage(xmlHttp.responseText);
}, false);